Data Summary

Read about the data, outer_space_objects.csv: https://github.com/rfordatascience/tidytuesday/tree/master/data/2024/2024-04-23

This data set contains information on the number of objects launched in space by different entities and countries from 1956 to 2023. “Objects” refers to satellites, probes, landers, crewed spacecrafts, and space station flight elements launched into or beyond Earth’s orbit. The data was collected by the United Nations Office for Outer Space Affairs in 2024 and cleaned by Our World in Data. The data contains four variables: Entity (entity, country, or other agency/organization), Code (entity code), Year, or num_objects (annual number of objects launched into outer space).

For each of my visualizations, I created a cum_num_objects column, which added the number of space objects for each entity over the years in the data.

Visualizations

Viz 2

Description

For both of my visualizations, I chose to focus on the top countries/entities in order to minimize clutter. Also, though all entities in the data set contribute to showing the relative increase in space exploration over the last 70 years, the top countries and entities show the most dramatic and observable increase. In Viz 1, “top 10 countries” refers to the top 10 countries that have launched the most space objects from 1957-2023. In Viz 2, “top 8 agencies” refers to the top 8 entities, such as government or private organizations, that have launched the most space objects from 1957-2023.

Viz 1 is a Shiny App that shows the top 10 countries’ total number of objects in space over a specified range of years. The app contains a slider input which allows the user to toggle between different year ranges with the default range set from 1957 to 2023 (all years in the data). This viz is effective because it allows the viewer to see the the increase in total space objects over the past 70 years as well as the how the top 10 countries have increased their numbers of space objects. More specifically, the viewer can see the time at which the number of objects in space exponentially increased and which countries primarily drove that change. The viewer can set different year ranges to zoom in or zoom out on the data and contextualize trends of relative stability or increase of the total number of space objects.

Around 2017, the total space objects began to exponentially increase. Looking at the fill of the bars, India is the country that appeared to drive the drastic uptick. From 2017 to 2023, the total number of objects in space launched by the top 10 countries more than doubled; in 2017, less than 7,500 objects were launched in space, but by 2023, this number rose to over 15,000.

Viz 2 is an interactive line plot which shows the total number of space objects launched by the top 8 entities that are not countries over the past 70 years. Comparing the number of space objects launched by countries versus other entities, such as government or private organizations, is important in understanding who is primarily driving human space exploration. Viz 2 reveals that while some organizations have had constant to little no increase in the number of objects they’ve launched, others have participated in dramatic increases. Looking at the plot, Intelstat and the European Space Agency launched similar numbers of objects in space until 2004, when Intelsat’s growth leveled off and European Space Agency continued to increase, having launched over 40 more space objects than Intelsat today.

This viz is effective for three reasons. First, the time series design allows the user to see the relative increases of entities’ participation in space exploration from 1957 to 2023. Second, interactive features allow the user to hover over a line and see the year, entity, and number of space objects they’d launched, minimizing visual load by elminating the need to look between the data, legend, and axes. Third, the aesthetic properties of the plot, such as color, font size, axis labels, and line plot with data points are informative and effective in communicating information without overwhelming the user.

Appendix

The appendix includes all code used to perform exploratory data analysis and create the visualizations.

library(dplyr)
library(plotly)
library(ggplot2)
library(viridis)
df <- read.csv("~/Desktop/STAT 3280/Tidy Tuesday/outer_space_objects.csv") 
head(df)
##    Entity Code Year num_objects
## 1   APSCO      2023           1
## 2 Algeria  DZA 2002           1
## 3 Algeria  DZA 2010           1
## 4 Algeria  DZA 2016           3
## 5 Algeria  DZA 2017           1
## 6  Angola  AGO 2017           1
table(df$Entity)
## 
##               Algeria                Angola                 APSCO 
##                     4                     2                     1 
##               Arabsat             Argentina               Armenia 
##                    11                    16                     1 
##             Australia               Austria            Azerbaijan 
##                    22                     2                     3 
##            Bangladesh               Belarus               Belgium 
##                     2                     4                     6 
##                Bhutan               Bolivia                Brazil 
##                     1                     1                    25 
##              Bulgaria                Canada                 Chile 
##                     4                    39                     5 
##                 China              Colombia            Costa Rica 
##                    48                     3                     1 
##               Czechia               Denmark              Djibouti 
##                     9                    10                     1 
##               Ecuador                 Egypt               Estonia 
##                     1                     8                     3 
##              Ethiopia              EUMETSAT European Space Agency 
##                     1                    11                    39 
##        European Union              Eutelsat               Finland 
##                     6                    21                     7 
##                France               Germany                 Ghana 
##                    41                    41                     1 
##                Greece             Guatemala               Hungary 
##                     4                     1                     3 
##                 India             Indonesia              Inmarsat 
##                    39                    20                     9 
##              Intelsat          Intersputnik                  Iran 
##                    34                     1                     8 
##               Ireland                Israel                 Italy 
##                     1                    22                    32 
##                 Japan                Jordan            Kazakhstan 
##                    53                     1                     5 
##                 Kenya                Kuwait                  Laos 
##                     1                     1                     1 
##                Latvia             Lithuania            Luxembourg 
##                     1                     6                    26 
##              Malaysia             Mauritius                Mexico 
##                     8                     1                    14 
##               Moldova                Monaco              Mongolia 
##                     1                     1                     1 
##               Morocco                  NATO                 Nepal 
##                     3                     5                     1 
##           Netherlands           New Zealand               Nigeria 
##                     8                     5                     3 
##           North Korea                Norway              Pakistan 
##                     3                    13                     5 
##      Papua New Guinea              Paraguay                  Peru 
##                     2                     1                     3 
##           Philippines                Poland              Portugal 
##                     5                     8                     1 
##                 Qatar                RASCOM               Romania 
##                     1                     2                     1 
##                Russia                Rwanda          Saudi Arabia 
##                    67                     2                     7 
##            Sea Launch             Singapore              Slovakia 
##                     1                     8                     2 
##              Slovenia          South Africa           South Korea 
##                     2                     7                    18 
##                 Spain             Sri Lanka               Starsem 
##                    22                     1                     1 
##                Sweden           Switzerland                Taiwan 
##                    14                     7                     8 
##              Thailand               Tunisia                Turkey 
##                    14                     1                    16 
##          Turkmenistan                Uganda               Ukraine 
##                     1                     1                     8 
##  United Arab Emirates        United Kingdom         United States 
##                    14                    38                    66 
##               Uruguay             Venezuela               Vietnam 
##                     8                     3                     4 
##                 World              Zimbabwe 
##                    67                     1
table(df$Code)
## 
##               AGO      ARE      ARG      ARM      AUS      AUT      AZE 
##      142        2       14       16        1       22        2        3 
##      BEL      BGD      BGR      BLR      BOL      BRA      BTN      CAN 
##        6        2        4        4        1       25        1       39 
##      CHE      CHL      CHN      COL      CRI      CZE      DEU      DJI 
##        7        5       48        3        1        9       41        1 
##      DNK      DZA      ECU      EGY      ESP      EST      ETH      FIN 
##       10        4        1        8       22        3        1        7 
##      FRA      GBR      GHA      GRC      GTM      HUN      IDN      IND 
##       41       38        1        4        1        3       20       39 
##      IRL      IRN      ISR      ITA      JOR      JPN      KAZ      KEN 
##        1        8       22       32        1       53        5        1 
##      KOR      KWT      LAO      LKA      LTU      LUX      LVA      MAR 
##       18        1        1        1        6       26        1        3 
##      MCO      MDA      MEX      MNG      MUS      MYS      NGA      NLD 
##        1        1       14        1        1        8        3        8 
##      NOR      NPL      NZL OWID_WRL      PAK      PER      PHL      PNG 
##       13        1        5       67        5        3        5        2 
##      POL      PRK      PRT      PRY      QAT      ROU      RUS      RWA 
##        8        3        1        1        1        1       67        2 
##      SAU      SGP      SVK      SVN      SWE      THA      TKM      TUN 
##        7        8        2        2       14       14        1        1 
##      TUR      TWN      UGA      UKR      URY      USA      VEN      VNM 
##       16        8        1        8        8       66        3        4 
##      ZAF      ZWE 
##        7        1
table(df$Year)
## 
## 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 
##    2    3    3    3    3    5    3    5    6    5    8    5    8   11   11    9 
## 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 
##    5   12   11   11    8    9    7    6   10    8   12   14   13    8    9   14 
## 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 
##   11   19   19   20   18   15   21   23   20   24   23   24   18   20   19   17 
## 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 
##   16   20   21   26   23   23   27   31   36   38   28   30   41   48   40   32 
## 2021 2022 2023 
##   42   46   49
# Getting countries with top 10 space objects
sorted_objects <- df[order(-df$num_objects), ]
top10 <- sorted_objects[1:10, ]
top10 
##             Entity     Code Year num_objects
## 1174         World OWID_WRL 2023        2664
## 1173         World OWID_WRL 2022        2478
## 1092 United States      USA 2023        2166
## 1091 United States      USA 2022        1939
## 1172         World OWID_WRL 2021        1813
## 1171         World OWID_WRL 2020        1274
## 1090 United States      USA 2021        1232
## 1089 United States      USA 2020         984
## 1170         World OWID_WRL 2019         586
## 1168         World OWID_WRL 2017         456

Viz 1 Code

# Sort data by unique entities with highest number of space objects
df_sorted <- df %>%
  group_by(Entity) %>% 
  summarize(num_objects = n()) %>% 
  arrange(desc(num_objects)) 
# Get top 15 entities
top_entities <- df_sorted[1:15,]
# Filter out entities that aren't countries 
top_countries <- top_entities %>% 
  filter(!(Entity %in% c("World", "European Space Agency", "Intelsat")))

# Get only top 10 countries
top10_countries <- top_countries[1:10, ] 
top10_countries
## # A tibble: 10 × 2
##    Entity         num_objects
##    <chr>                <int>
##  1 Russia                  67
##  2 United States           66
##  3 Japan                   53
##  4 China                   48
##  5 France                  41
##  6 Germany                 41
##  7 Canada                  39
##  8 India                   39
##  9 United Kingdom          38
## 10 Italy                   32
# Create df with only top 10 countries who have the most total space objects 
top10df <- df %>% 
  filter(Entity %in% top10_countries$Entity)
# Get cumulative number of objects in space over the years for each entity
top10df <- top10df %>% 
  arrange(Year) %>% 
  group_by(Entity) %>%
  mutate(cum_num_objects = cumsum(num_objects))

# top10df
# Export data to be used in Shiny App
write.csv(top10df, "~/Desktop/STAT 3280/Tidy Tuesday/top10_countries.csv")
# Original plot to be used in Shiny App
p1 <- ggplot(top10df, aes(x = Year, y = cum_num_objects, fill = Entity)) + 
  geom_bar(stat = "identity") + 
  scale_fill_viridis_d() + 
  theme_minimal() + 
  labs(title = "Top 10 Countries' Space Objects from 1957-2023", y = "Total Number of Objects in Space", fill = "Country") + 
  theme(plot.title = element_text(hjust = 0.5, size = 20), 
        axis.title = element_text(size = 18), 
        axis.text = element_text(size = 16))
        
p1

# Shiny App Code 

library(shiny)
library(ggplot2)
library(viridis)

# Define UI
ui <- fluidPage(
  sidebarLayout(
    sidebarPanel(
      uiOutput("year_slider")
      ), 
    mainPanel(
      plotOutput("plot")
    )
  )
)

# Define server

server <- function(input, output) {
  
  df <- read.csv("top10_countries.csv") 
  
  output$year_slider <- renderUI({
    sliderInput("year_range", "Select Year Range:",
                min = min(df$Year), max = max(df$Year),
                value = c(min(df$Year), max(df$Year)), 
                step = 1)
    
  })
  output$plot <- renderPlot({
    # Filter data based on selected year range
    filtered_df <- subset(df, Year >= input$year_range[1] & Year <= input$year_range[2])
    
    # Plot
    p <- ggplot(filtered_df, aes(x = Year, y = cum_num_objects, fill = Entity)) + 
      geom_bar(stat = "identity") + 
      scale_fill_viridis_d() + 
      theme_minimal() + 
      labs(title = paste("Top 10 Countries' Total Number of Objects in Space from", input$year_range[1], "-", input$year_range[2]),
           y = "Number of Objects in Space", fill = "Country") + 
      theme(plot.title = element_text(hjust = 0.5, size = 22), 
            axis.title = element_text(size = 18), 
            axis.text = element_text(size = 16))
    
    p
  })
}

# Run the application
shinyApp(ui = ui, server = server)
Shiny applications not supported in static R Markdown documents

Viz 2 Code

# table(df$Entity)
# Create dataframe of entities that aren't countries, regions, or 'World' 
orgs <- c("APSCO", "Arabsat", "EUMETSAT", "European Space Agency", "Eutelsat", "Inmarsat", "Intelsat", "Intersputnik", "NATO", "RASCOM", "Sea Launch", "Starsem")

org_df <- df %>% 
  filter(Entity %in% orgs)

org_df
##                    Entity Code Year num_objects
## 1                   APSCO      2023           1
## 2                 Arabsat      1985           2
## 3                 Arabsat      1992           1
## 4                 Arabsat      1996           2
## 5                 Arabsat      1999           1
## 6                 Arabsat      2006           2
## 7                 Arabsat      2008           1
## 8                 Arabsat      2010           2
## 9                 Arabsat      2011           1
## 10                Arabsat      2015           1
## 11                Arabsat      2019           1
## 12                Arabsat      2023           1
## 13               EUMETSAT      1989           1
## 14               EUMETSAT      1991           1
## 15               EUMETSAT      1993           1
## 16               EUMETSAT      1997           1
## 17               EUMETSAT      2002           2
## 18               EUMETSAT      2005           1
## 19               EUMETSAT      2006           1
## 20               EUMETSAT      2012           2
## 21               EUMETSAT      2015           1
## 22               EUMETSAT      2018           1
## 23               EUMETSAT      2022           1
## 24  European Space Agency      1968           5
## 25  European Space Agency      1969           2
## 26  European Space Agency      1972           6
## 27  European Space Agency      1975           2
## 28  European Space Agency      1977           1
## 29  European Space Agency      1978           2
## 30  European Space Agency      1979           1
## 31  European Space Agency      1981           3
## 32  European Space Agency      1983           2
## 33  European Space Agency      1985           1
## 34  European Space Agency      1988           2
## 35  European Space Agency      1989           2
## 36  European Space Agency      1990           2
## 37  European Space Agency      1991           1
## 38  European Space Agency      1992           1
## 39  European Space Agency      1995           3
## 40  European Space Agency      1997           3
## 41  European Space Agency      1998           1
## 42  European Space Agency      1999           1
## 43  European Space Agency      2000           4
## 44  European Space Agency      2001           2
## 45  European Space Agency      2002           4
## 46  European Space Agency      2003           3
## 47  European Space Agency      2004           2
## 48  European Space Agency      2005           6
## 49  European Space Agency      2008           3
## 50  European Space Agency      2009           5
## 51  European Space Agency      2010           1
## 52  European Space Agency      2011           3
## 53  European Space Agency      2012           3
## 54  European Space Agency      2013           6
## 55  European Space Agency      2014           2
## 56  European Space Agency      2015           3
## 57  European Space Agency      2016           4
## 58  European Space Agency      2017           2
## 59  European Space Agency      2018           4
## 60  European Space Agency      2019           2
## 61  European Space Agency      2020           2
## 62  European Space Agency      2023           2
## 63               Eutelsat      1983           1
## 64               Eutelsat      1984           1
## 65               Eutelsat      1987           1
## 66               Eutelsat      1990           1
## 67               Eutelsat      1991           2
## 68               Eutelsat      1992           1
## 69               Eutelsat      1995           1
## 70               Eutelsat      1996           1
## 71               Eutelsat      1997           1
## 72               Eutelsat      1998           3
## 73               Eutelsat      1999           1
## 74               Eutelsat      2000           3
## 75               Eutelsat      2001           2
## 76               Eutelsat      2002           3
## 77               Eutelsat      2003           1
## 78               Eutelsat      2004           1
## 79               Eutelsat      2006           2
## 80               Eutelsat      2008           2
## 81               Eutelsat      2009           3
## 82               Eutelsat      2015           1
## 83               Eutelsat      2016           1
## 84               Inmarsat      1976           3
## 85               Inmarsat      1981           1
## 86               Inmarsat      1984           1
## 87               Inmarsat      1990           1
## 88               Inmarsat      1991           2
## 89               Inmarsat      1992           1
## 90               Inmarsat      1996           3
## 91               Inmarsat      1997           1
## 92               Inmarsat      1998           1
## 93               Intelsat      1965           1
## 94               Intelsat      1966           1
## 95               Intelsat      1967           3
## 96               Intelsat      1968           1
## 97               Intelsat      1969           3
## 98               Intelsat      1970           3
## 99               Intelsat      1971           2
## 100              Intelsat      1972           2
## 101              Intelsat      1973           1
## 102              Intelsat      1974           1
## 103              Intelsat      1975           2
## 104              Intelsat      1976           1
## 105              Intelsat      1978           2
## 106              Intelsat      1980           1
## 107              Intelsat      1981           1
## 108              Intelsat      1982           2
## 109              Intelsat      1983           2
## 110              Intelsat      1984           2
## 111              Intelsat      1985           3
## 112              Intelsat      1988           1
## 113              Intelsat      1989           2
## 114              Intelsat      1990           2
## 115              Intelsat      1991           2
## 116              Intelsat      1992           1
## 117              Intelsat      1993           1
## 118              Intelsat      1994           2
## 119              Intelsat      1995           3
## 120              Intelsat      1996           2
## 121              Intelsat      1997           4
## 122              Intelsat      1998           2
## 123              Intelsat      2008           1
## 124              Intelsat      2011           1
## 125              Intelsat      2012           1
## 126              Intelsat      2014           1
## 127          Intersputnik      1999           1
## 128                  NATO      1970           1
## 129                  NATO      1971           1
## 130                  NATO      1976           1
## 131                  NATO      1984           1
## 132                  NATO      1991           1
## 133                RASCOM      2007           1
## 134                RASCOM      2010           1
## 135            Sea Launch      1999           1
## 136               Starsem      2000           2
# Create column with cumulative number of space objects over the years 
org_df <- org_df %>% 
  arrange(Year) %>% 
  group_by(Entity) %>% 
  mutate(cum_num_objects = cumsum(num_objects))

org_df
## # A tibble: 136 × 5
## # Groups:   Entity [12]
##    Entity                Code   Year num_objects cum_num_objects
##    <chr>                 <chr> <int>       <int>           <int>
##  1 Intelsat              ""     1965           1               1
##  2 Intelsat              ""     1966           1               2
##  3 Intelsat              ""     1967           3               5
##  4 European Space Agency ""     1968           5               5
##  5 Intelsat              ""     1968           1               6
##  6 European Space Agency ""     1969           2               7
##  7 Intelsat              ""     1969           3               9
##  8 Intelsat              ""     1970           3              12
##  9 NATO                  ""     1970           1               1
## 10 Intelsat              ""     1971           2              14
## # ℹ 126 more rows
line_plot <- ggplot(org_df, aes(x = Year, y = cum_num_objects, color = Entity)) + 
  geom_point() + geom_line()
line_plot

# Removing agencies with low number of space objects / not present over several years
org_df2 <- org_df %>% 
  filter(! Entity %in% c("RASCOM", "Sea Launch", "Starsem", "APSCO", "Intersputnik"))
line_plot2 <- ggplot(org_df2, aes(x = Year, y = cum_num_objects, color = Entity)) + 
  geom_point() + geom_line()
line_plot2

# Making a plotly version of the above line plot 

p2colors <- viridisLite::viridis(7)

plot2 <- plot_ly(org_df2, x = ~Year, y = ~cum_num_objects, color = ~Entity, colors = p2colors,
                 text = ~paste(Entity, Year, ": ", cum_num_objects), hoverinfo = "text",
                 type = "scatter", mode = "lines+markers") %>% 
  # Customizing title and axis labels
  layout(title = list(text = "Top 8 Agencies' Total Number of Objects in Space 1957-2023", size = 18), 
         xaxis = list(titlefont = list(size = 16), tickfont = list(size = 14)),
         yaxis = list(title = "Number of Objects", titlefont = list(size = 16), tickfont = list(size = 14)),
         showlegend = TRUE) %>% 
  # Customizing x-axis 
  layout(xaxis = list(
    tickmode = "array", 
    tickvals = seq(1957, 2023, by = 10), 
    ticktext = seq(1950, 2030, by = 10)
  ))

plot2